package com.wow.wa.bill.serivce;

import java.util.List;

import android.content.Context;

import com.wow.wa.bill.serivce.vo.DateRange;
import com.wow.wa.bill.vo.Bill;
import com.wow.wa.bill.vo.Card;
import com.wow.wa.bill.vo.Category;

public interface BillService {

	public void insertBillAndNotify(Bill bill);

	public Card getCardByBill(Bill bill);
	
	

	/**
	 * 今天是否有進行一次判斷
	 * 
	 * @return
	 */
	public boolean hasBroadCastRec();

	/**
	 * 新增記錄
	 */
	public void insertBroadCastRec();

	/**
	 * 取得所有帳單
	 * 
	 * @return
	 */
	List<Bill> getBill(Context context) throws Exception;

	List<Bill> getBillWithNoPaid(Context context) throws Exception;

	List<Bill> getBillOverDay(Context context) throws Exception;

	List<Bill> getBill(String payType, Context context) throws Exception;

	public List<Category> getCategorys(String id, Context context);

	/**
	 * 新增帳單
	 * 
	 * @param bill
	 */
	void insertBill(Bill bill, Context context) throws Exception;

	void insertCard(Card card, Context context) throws Exception;

	/**
	 * 刪除帳單
	 * 
	 * @param bill
	 */
	public void deleteBill(String tx, Context context) throws Exception;

	/**
	 * 更新帳單
	 * 
	 * @param bill
	 */
	public void updateBill(Bill bill, String tx, Context context)
			throws Exception;

	public List<Category> getCategorys(Context context);

	// public String[] getStringPayTyp(Context context);

	// public String[] getStringCategorys(Context context) ;

	public List<String> getStringPayTyp(Context context);

	public List<String> getStringCategorys(Context context);

	/**
	 * 
	 * 
	 * @param bill
	 * @param context
	 */
	public void updateBillToPayed(Bill bill, Context context) throws Exception;

	public void updateBill(Bill bill, Context context) throws Exception;

	public void deeteBill(Bill bill, Context context) throws Exception;

	public void updateBillToNoPayed(Bill bill, Context context)
			throws Exception;

	/**
	 * 計算所有帳單尚未繳款的金額
	 * 
	 * @param bills
	 * @throws Exception
	 */
	public String stringByCountTotalMoneyWithNoPay(List<Bill> bills)
			throws Exception;

	public List<Card> getCard(Context context);

	/**
	 * 計算所有帳單已繳款的金額
	 * 
	 * @param bills
	 * @throws Exception
	 */
	public String stringBycountTotalMoneyWithPay(List<Bill> bills)
			throws Exception;

	public DateRange getRangDay(Card card, Context context);

	public void updateCard(Card card, Context context);

	public List<Bill> getBill(String type, String start, String end,
			Context context) throws Exception;

	public String getCardTypeName(String CardId);

	public String getCategoryName(String id);

}
